import javax.swing.*;
import java.awt.*;

public class btnRedCommand extends JMenuItem implements Command {
    private JPanel panel; //clasa are ca parametru panelul pem care trebuie sa il coloreze
    private Color color;
    
    public btnRedCommand(JPanel panel,Color color)
    {
        this.panel=panel; 
        this.color=color;
    }

    public void execute()
    {
        this.panel.setBackground(this.color); //aceasta metoda este responsabila pt colorarea panelului in rosu
    }

}
